<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<table width="100%">
	<tbody>
		<tr>
			<td height="40" class="sectionheading bottom-border">
				Location
			</td>
		</tr>
		<tr>
			<td>
				<table class="verdana12blacknormal">
					<tbody>
						<tr align="right">
							<td align="right">
								<s:a href="displayAllCategoryForEdit.htm?categoryId=%{categoryId}" cssClass="verdana11greynormal">Edit All</s:a>
							</td>

						</tr>
					</tbody>
				</table>

				<table width="100%">
					<tbody>
						<tr align="left">
							<td>
								<s:a
									href="showLocationCategories.htm" cssClass="navi-link"> Top</s:a> <s:set name="id"
										value="%{categoryId}" />

										<s:iterator value="categoryNames">
										-----&gt;
										<s:if test="%{#id == categoryId}">
										<font class="verdana11greynormal">
											<s:property value="categoryName" />
										</font>
										</s:if>

										<s:else>
											<s:a cssClass="verdana11greynormal"
												href="showLocationCategories.htm?categoryId=%{categoryId}">
												<s:property value="categoryName" />
											</s:a>
										</s:else>
									</s:iterator>
							</td>
						</tr>
					</tbody>
				</table>
			</td>
		</tr>

		<tr>
			<td>
				<table width="100%" border="0" cellpadding="0" cellspacing="0"
					class="Textfiled-border">
					<tbody>
						<tr align="center" height="25">
							<td align="center" bgcolor="#E9E9E9"
								class="right-border verdana12darkgreybold">
								<b>Category</b>
							</td>
							<td align="center" bgcolor="#E9E9E9"
								class="right-border verdana12darkgreybold">
								<b>Teaser</b>
							</td>
							<td align="center" bgcolor="#E9E9E9"
								class="right-border verdana12darkgreybold">
								<b>Sort</b>
							</td>
							<td colspan="2" align="center" bgcolor="#E9E9E9"
								class="verdana12darkgreybold">
								<b>Action</b>
							</td>
						</tr>
						<s:if test="%{locationCategoriesList.size == 0}">
							<tr align="left" height="25">
								<td COLSPAN="6" align="left" bgcolor="#FFFFFF"
									class="verdana12darkgreybold">
									<br>
									No More Subcategories.
									<br>
								</td>
							</tr>
						</s:if>
						<s:else>
							<s:iterator value="locationCategoriesList" status="rowstatus">
								<s:set name="classCSS" value="%{'Textfiled-no-border-odd'}"
									var="classCSS"></s:set>
								<s:set name="bgColor" value="%{'#FFFFFF'}" var="bgColor"></s:set>

								<s:if test="#rowstatus.even">
									<s:set var="classCSS" value="%{'Textfiled-no-border-even'}"></s:set>
									<s:set var="bgColor" value="%{'#F8F8F8'}"></s:set>
								</s:if>
								<tr height="30">
									<td width="71%" align="left"
										class="verdana12Greybold right-border"
										bgcolor="<s:property value="%{bgColor}" />">
										&nbsp;
										<s:a
											href="showLocationCategories.htm?categoryId=%{categoryId}">
											<s:property value="categoryName" />
										</s:a>
									</td>
									<td align="center" class="verdana12Greybold right-border"
										bgcolor="<s:property value="%{bgColor}" />" width="12%">
										<s:if test="%{categoryTeaser == false}">
											<img src="../images/no.gif"
												alt="NO" border="0">
										</s:if>
										<s:if test="%{categoryTeaser == true}">
											<img
												src="../images/yes.gif"
												alt="NO" border="0">
										</s:if>
									</td>
									<td align="center" class="verdana12Greybold right-border"
										bgcolor="<s:property value="%{bgColor}" />" width="10%">
										<s:property value="sortOrder" />
									</td>
									<td align="right" bgcolor="<s:property value="%{bgColor}" />" width="8%">
										<table border="0" cellpadding="0" cellspacing="0" width="80%" >
											<tr>
												<td width="40%" valign="top">
													<s:url id="edit" action="setForInsertOrUpdateCategory">
														<s:param name="categoryId" value="categoryId"></s:param>
													</s:url>
													<s:a href="%{edit}">
														<img src="../Admin-Images/edit-icon.gif" style="border: 0" alt="Edit">
													</s:a>
												</td>
												<td align="center" class="verdana12Greybold" valign="middle" bgcolor="<s:property value="%{bgColor}" />" width="40%">
													<s:url id="delete" action="displayAllCategory">
														<s:param name="categoryId" value="categoryId"></s:param>
													</s:url>
													<s:a href="%{delete}">
														<img src="../Admin-Images/delete-icon.gif" align="top" style="border: 0" alt="Delete">
													</s:a>
												</td>
											</tr>
										</table>
									</td>

								</tr>
							</s:iterator>
						</s:else>
					</tbody>
				</table>

				<s:form id="form" method="get" action="addNewCategories" theme="simple">

					<s:hidden name="categoryTeaser" value="false"></s:hidden>

					<table width="100%" >
						<tbody>
							<tr>
								<td>
									&nbsp;
								</td>
							</tr>
							<tr align="left" >
								<td align="left" class="verdana12darkgreybold">
									Create New
									<s:if test="%{subCategory == true}">SubLocations</s:if>
									<s:else>Locations</s:else>
								</td>
							</tr>
						</tbody>
					</table>

					<table width="100%" >
						<tbody>
						<tr>
							<td>
								<s:actionerror cssClass="Note-red" />
								<s:fielderror></s:fielderror>
							</td>
						</tr>
							<tr>
								<td colspan="2" width="100%">
									<table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody>
											<tr>
												<td align="left" valign="top" class="verdana12blacknormal">
													<p align="justify">
														Please enter one location name per line and press enter at
														the end of each line.
														<br>

														locations will be created under the current location
														shown by the guide bar.
														<br>
														You can create any number of location.
													</p>
												</td>
											</tr>
											<tr>
												<td>
													&nbsp;
												</td>
											</tr>
											<tr>
												<td align="left" class="verdana12Greybold">
													<s:a cssClass="navi-link"
														href="showLocationCategories.htm"> Top</s:a> <s:iterator
															value="categoryNames">
																		-----&gt;
																		<s:if test="%{#id == categoryId}">
																<font class="verdana11greynormal">
																	<s:property value="categoryName" />
																</font>
															</s:if>

															<s:else>
																<s:a cssClass="verdana11greynormal"
																	href="showLocationCategories.htm?categoryId=%{categoryId}">
																	<s:property value="categoryName" />
																</s:a>
															</s:else>

														</s:iterator>
												</td>
											</tr>
											<tr>
												<td align="left" align="center" class="verdana12Greybold" bgcolor="<s:property value="%{bgColor}" />">
													<s:hidden name="categoryId" value="%{categoryId}" />
													<s:textarea name="categoryArea" cols="80" rows="10" cssClass="TextFiled" />
												</td>
											</tr>
											<tr>
												<td>
													&nbsp;
												</td>
											</tr>
											<tr>
												<td align="center" valign="top">
													<s:if test="%{subCategory == true}"><s:submit type="image" value="Create Categories"
															src="../Admin-Images/create-sub-location-btn.gif"></s:submit>
													</s:if>
													<s:else>
														<s:submit type="image" value="Create Categories"
															src="../Admin-Images/create-location-btn.gif"></s:submit>
													</s:else>
													<img style="cursor: pointer;" onclick="document.getElementById('form').reset();" src="../Admin-Images/reset-button.gif" alt="Reset">
												</td>
											</tr>
										</tbody>
									</table>
								</td>
							</tr>
						</tbody>
					</table>
				</s:form>
				<br>
			</td>
		</tr>
	</tbody>
</table>